package org.classg.edu.controller;

import org.classg.utils.R;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin
public class LoginController {

    @PostMapping("/login")
    public R login() {
        return R.ok().data("username", "admin").data("password", "admin");
    }

    @GetMapping("/info")
    public R info() {
        Map<String, Object> map = new HashMap<>();
        map.put("roles","管理员" );
        map.put("name","Classg" );
        map.put("avatar","http://b-ssl.duitang.com/uploads/item/201504/03/20150403H2750_BFKvR.gif" );
        return R.ok().data(map);
    }
}
